Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Private Const WM_SETTEXT = &HC
Private Sub Command1_Click()
Dim wnd As Long
wnd = FindWindow(vbNullString, "目标窗体名称")
SetWindowText wnd, "新的名字写在这里"
End Sub
本文来自胡摘网[http://z.hackpro.cn],转载请标明出处:http://www.hackpro.cn/art/2734.html